using System;
using FireStarterModeller.BO;
using Habanero.BO;
using NUnit.Framework;

namespace FireStarterModeller.Test.BO
{
    /// <summary>
    /// Provides a place to write custom tests for SolutionTypeProject objects.
    /// This file is only written once and can be changed.  The Def file
    /// attached to this as a dependent is rewritten with each regeneration
    /// and contains the standard tests for SolutionTypeProject.
    /// Regenerate this test project whenever there have been changes to the
    /// business objects.
    /// If tests are failing due to a unique setup in your application,
    /// you can either override the Create methods in TestUtils, or you
    /// can add the test to the ignore list below and reimplement it here.
    /// </summary>
    public partial class TestSolutionTypeProject
    {
        [SetUp]
        public override void SetupTest()
        {
            //Runs every time that any testmethod is executed
            base.SetupTest();
        }

        [TestFixtureSetUp]
        public void TestFixtureSetup()
        {
            //Code that is executed before any test is run in this class. If multiple tests
            // are executed then it will still only be called once.
            //------------------------------------------------------------
            // Use this list to ignore generated tests that are failing
            // due to a unique condition in your application.
            // Remember to reimplement the test here.
            //------------------------------------------------------------
            //_ignoreList.Add("TestMethodName", "Reason for ignoring it");
            base.SetupFixture();
        }

        [TearDown]
        public override void TearDownTest()
        {
            //runs every time any testmethod is complete
            base.TearDownTest();
        }

        [Test]
        public void Test_ToString()
        {
            //---------------Set up test pack-------------------
            SolutionTypeProject solutionTypeProject = TestUtilsSolutionTypeProject.CreateUnsavedValidSolutionTypeProject();
            //---------------Assert Precondition----------------
            Assert.IsNotNull(solutionTypeProject.SolutionType, "SolutionType Should not be null");
            Assert.IsNotNull(solutionTypeProject.ProjectType, "ProjectType Should not be null");
            //---------------Execute Test ----------------------
            string actualToString = solutionTypeProject.ToString();
            //---------------Test Result -----------------------
            string expectedToString = string.Format("{0} - {1}", 
                solutionTypeProject.SolutionType.Name,
                solutionTypeProject.ProjectType.Name);
            Assert.AreEqual(expectedToString, actualToString);
        }
    }
}